import './StudentItem.scss'

export default function StudentItem({info, onCheck, ifChecked, deleteStu}) {


    function handleCheck(){
        onCheck(info.id);
    }

    return (
        <div className='StudentItem'>
            <input
                type='checkbox'
                onChange={handleCheck}
                checked={ifChecked||false}
            />
            <span className='stu-id'>
                {info.student_id}
            </span>
            <span className='stu-name'>
                {info.student_name}
            </span>
            <button
                onClick={()=>{
                    deleteStu(info.student_name);
                }}
            >移除</button>
        </div>
    )
}